<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>RaspBerryPi power control: SPI access</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RaspBerryPi power control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">SPI access</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac888dc9b78b695f6c13eeeaa813c0d82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gac888dc9b78b695f6c13eeeaa813c0d82">bcm2835_spi_begin</a> (void)</td></tr>
<tr class="separator:gac888dc9b78b695f6c13eeeaa813c0d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad25421b3a4a6ca280dfdd39c94c3279a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gad25421b3a4a6ca280dfdd39c94c3279a">bcm2835_spi_end</a> (void)</td></tr>
<tr class="separator:gad25421b3a4a6ca280dfdd39c94c3279a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0127eab1b6c3f8bf127bdac474fdc0f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga0127eab1b6c3f8bf127bdac474fdc0f9">bcm2835_spi_setBitOrder</a> (uint8_t order)</td></tr>
<tr class="memdesc:ga0127eab1b6c3f8bf127bdac474fdc0f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">see <a class="el" href="group__constants.html#ga1dd00efbd834646f75240c39a41c9856">bcm2835SPIBitOrder</a>  <a href="#ga0127eab1b6c3f8bf127bdac474fdc0f9">More...</a><br/></td></tr>
<tr class="separator:ga0127eab1b6c3f8bf127bdac474fdc0f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad623657d9513faa89d22ae1dc87eec38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gad623657d9513faa89d22ae1dc87eec38">bcm2835_spi_setClockDivider</a> (uint16_t divider)</td></tr>
<tr class="memdesc:gad623657d9513faa89d22ae1dc87eec38"><td class="mdescLeft">&#160;</td><td class="mdescRight">see <a class="el" href="group__constants.html#gaf2e0ca069b8caef24602a02e8a00884e">bcm2835SPIClockDivider</a>  <a href="#gad623657d9513faa89d22ae1dc87eec38">More...</a><br/></td></tr>
<tr class="separator:gad623657d9513faa89d22ae1dc87eec38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabfbf797499756d38e3667f05ee8fd11d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gabfbf797499756d38e3667f05ee8fd11d">bcm2835_spi_setDataMode</a> (uint8_t mode)</td></tr>
<tr class="memdesc:gabfbf797499756d38e3667f05ee8fd11d"><td class="mdescLeft">&#160;</td><td class="mdescRight">see <a class="el" href="group__constants.html#ga8dd7bb496565324800130100e6bf6d86">bcm2835SPIMode</a>  <a href="#gabfbf797499756d38e3667f05ee8fd11d">More...</a><br/></td></tr>
<tr class="separator:gabfbf797499756d38e3667f05ee8fd11d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2fa186568605c21e9166a19b1d82ea95"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga2fa186568605c21e9166a19b1d82ea95">bcm2835_spi_chipSelect</a> (uint8_t cs)</td></tr>
<tr class="separator:ga2fa186568605c21e9166a19b1d82ea95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee4edaf16fe21455441965bc57e78724"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gaee4edaf16fe21455441965bc57e78724">bcm2835_spi_setChipSelectPolarity</a> (uint8_t cs, uint8_t active)</td></tr>
<tr class="separator:gaee4edaf16fe21455441965bc57e78724"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga600dc972f1064908b41b349c92d7647d"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga600dc972f1064908b41b349c92d7647d">bcm2835_spi_transfer</a> (uint8_t value)</td></tr>
<tr class="separator:ga600dc972f1064908b41b349c92d7647d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac24692f270bb3411990ea706ddd4fee9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#gac24692f270bb3411990ea706ddd4fee9">bcm2835_spi_transfernb</a> (char *tbuf, char *rbuf, uint32_t len)</td></tr>
<tr class="separator:gac24692f270bb3411990ea706ddd4fee9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06884e9cd71dfe380f846b09f47b7248"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga06884e9cd71dfe380f846b09f47b7248">bcm2835_spi_transfern</a> (char *buf, uint32_t len)</td></tr>
<tr class="separator:ga06884e9cd71dfe380f846b09f47b7248"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These functions let you use SPI0 (Serial Peripheral Interface) to interface with an external SPI device. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gac888dc9b78b695f6c13eeeaa813c0d82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_begin </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Start SPI operations. Forces RPi SPI0 pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) to alternate function ALT0, which enables those pins for SPI interface. You should call <a class="el" href="group__spi.html#gad25421b3a4a6ca280dfdd39c94c3279a">bcm2835_spi_end()</a> when all SPI funcitons are complete to return the pins to their default functions </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__spi.html#gad25421b3a4a6ca280dfdd39c94c3279a">bcm2835_spi_end()</a> </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gac888dc9b78b695f6c13eeeaa813c0d82_cgraph.png" border="0" usemap="#group__spi_gac888dc9b78b695f6c13eeeaa813c0d82_cgraph" alt=""/></div>
<map name="group__spi_gac888dc9b78b695f6c13eeeaa813c0d82_cgraph" id="group__spi_gac888dc9b78b695f6c13eeeaa813c0d82_cgraph">
<area shape="rect" id="node2" href="group__gpio.html#gaf866b136c0a9fd4cca4065ce51eb4495" title="bcm2835_gpio_fsel" alt="" coords="217,5,362,32"/><area shape="rect" id="node5" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="643,56,794,83"/><area shape="rect" id="node6" href="group__lowlevel.html#ga1c158b76d194b94d0b2fb1488f9ff30e" title="bcm2835_peri_write_nb" alt="" coords="203,107,376,133"/><area shape="rect" id="node3" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="424,5,595,32"/><area shape="rect" id="node4" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="644,5,793,32"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga2fa186568605c21e9166a19b1d82ea95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_chipSelect </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>cs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the chip select pin(s) When an <a class="el" href="group__spi.html#ga600dc972f1064908b41b349c92d7647d">bcm2835_spi_transfer()</a> is made, the selected pin(s) will be asserted during the transfer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cs</td><td>Specifies the CS pins(s) that are used to activate the desired slave. One of BCM2835_SPI_CS*, see <a class="el" href="group__constants.html#ga29bba154633d37d07fa130a86e4a1f2a">bcm2835SPIChipSelect</a> </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_ga2fa186568605c21e9166a19b1d82ea95_cgraph.png" border="0" usemap="#group__spi_ga2fa186568605c21e9166a19b1d82ea95_cgraph" alt=""/></div>
<map name="group__spi_ga2fa186568605c21e9166a19b1d82ea95_cgraph" id="group__spi_ga2fa186568605c21e9166a19b1d82ea95_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="235,31,405,57"/><area shape="rect" id="node3" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="455,5,604,32"/><area shape="rect" id="node4" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="454,56,605,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gad25421b3a4a6ca280dfdd39c94c3279a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_end </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>End SPI operations. SPI0 pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) are returned to their default INPUT behaviour. </p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gad25421b3a4a6ca280dfdd39c94c3279a_cgraph.png" border="0" usemap="#group__spi_gad25421b3a4a6ca280dfdd39c94c3279a_cgraph" alt=""/></div>
<map name="group__spi_gad25421b3a4a6ca280dfdd39c94c3279a_cgraph" id="group__spi_gad25421b3a4a6ca280dfdd39c94c3279a_cgraph">
<area shape="rect" id="node2" href="group__gpio.html#gaf866b136c0a9fd4cca4065ce51eb4495" title="bcm2835_gpio_fsel" alt="" coords="193,31,338,57"/><area shape="rect" id="node3" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="387,31,557,57"/><area shape="rect" id="node4" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="607,5,756,32"/><area shape="rect" id="node5" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="606,56,757,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga0127eab1b6c3f8bf127bdac474fdc0f9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_setBitOrder </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>order</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>see <a class="el" href="group__constants.html#ga1dd00efbd834646f75240c39a41c9856">bcm2835SPIBitOrder</a> </p>
<p>Sets the SPI bit order NOTE: has no effect. Not supported by SPI0. Defaults to </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">order</td><td>The desired bit order, one of BCM2835_SPI_BIT_ORDER_*, </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaee4edaf16fe21455441965bc57e78724"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_setChipSelectPolarity </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>cs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>active</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the chip select pin polarity for a given pin When an <a class="el" href="group__spi.html#ga600dc972f1064908b41b349c92d7647d">bcm2835_spi_transfer()</a> occurs, the currently selected chip select pin(s) will be asserted to the value given by active. When transfers are not happening, the chip select pin(s) return to the complement (inactive) value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cs</td><td>The chip select pin to affect </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">active</td><td>Whether the chip select pin is to be active HIGH </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gaee4edaf16fe21455441965bc57e78724_cgraph.png" border="0" usemap="#group__spi_gaee4edaf16fe21455441965bc57e78724_cgraph" alt=""/></div>
<map name="group__spi_gaee4edaf16fe21455441965bc57e78724_cgraph" id="group__spi_gaee4edaf16fe21455441965bc57e78724_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="256,31,427,57"/><area shape="rect" id="node3" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="476,5,625,32"/><area shape="rect" id="node4" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="475,56,626,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gad623657d9513faa89d22ae1dc87eec38"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_setClockDivider </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>divider</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>see <a class="el" href="group__constants.html#gaf2e0ca069b8caef24602a02e8a00884e">bcm2835SPIClockDivider</a> </p>
<p>Sets the SPI clock divider and therefore the SPI clock speed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">divider</td><td>The desired SPI clock divider, one of BCM2835_SPI_CLOCK_DIVIDER_*, </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gad623657d9513faa89d22ae1dc87eec38_cgraph.png" border="0" usemap="#group__spi_gad623657d9513faa89d22ae1dc87eec38_cgraph" alt=""/></div>
<map name="group__spi_gad623657d9513faa89d22ae1dc87eec38_cgraph" id="group__spi_gad623657d9513faa89d22ae1dc87eec38_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="267,5,418,32"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gabfbf797499756d38e3667f05ee8fd11d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_setDataMode </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>mode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>see <a class="el" href="group__constants.html#ga8dd7bb496565324800130100e6bf6d86">bcm2835SPIMode</a> </p>
<p>Sets the SPI data mode Sets the clock polariy and phase </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>The desired data mode, one of BCM2835_SPI_MODE*, </td></tr>
  </table>
  </dd>
</dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gabfbf797499756d38e3667f05ee8fd11d_cgraph.png" border="0" usemap="#group__spi_gabfbf797499756d38e3667f05ee8fd11d_cgraph" alt=""/></div>
<map name="group__spi_gabfbf797499756d38e3667f05ee8fd11d_cgraph" id="group__spi_gabfbf797499756d38e3667f05ee8fd11d_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="253,31,424,57"/><area shape="rect" id="node3" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="473,5,623,32"/><area shape="rect" id="node4" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="473,56,623,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga600dc972f1064908b41b349c92d7647d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t bcm2835_spi_transfer </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Transfers one byte to and from the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer. Clocks the 8 bit value out on MOSI, and simultaneously clocks in data from MISO. Returns the read data byte from the slave. Uses polled transfer as per section 10.6.1 of teh BCM 2835 ARM Peripherls manual </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The 8 bit data byte to write to MOSI </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The 8 bit byte simultaneously read from MISO </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__spi.html#ga06884e9cd71dfe380f846b09f47b7248">bcm2835_spi_transfern()</a> </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_ga600dc972f1064908b41b349c92d7647d_cgraph.png" border="0" usemap="#group__spi_ga600dc972f1064908b41b349c92d7647d_cgraph" alt=""/></div>
<map name="group__spi_ga600dc972f1064908b41b349c92d7647d_cgraph" id="group__spi_ga600dc972f1064908b41b349c92d7647d_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="220,56,391,83"/><area shape="rect" id="node3" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="441,5,591,32"/><area shape="rect" id="node5" href="group__lowlevel.html#ga1c158b76d194b94d0b2fb1488f9ff30e" title="bcm2835_peri_write_nb" alt="" coords="219,107,392,133"/><area shape="rect" id="node6" href="group__lowlevel.html#ga0f541d0997978dd30f60231b64f10230" title="bcm2835_peri_read_nb" alt="" coords="219,157,391,184"/><area shape="rect" id="node4" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="441,56,591,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga06884e9cd71dfe380f846b09f47b7248"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_transfern </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Transfers any number of bytes to and from the currently selected SPI slave using bcm2835_spi_transfernb. The returned data from the slave replaces the transmitted data in the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">buf</td><td>Buffer of bytes to send. Received bytes will replace the contents </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Number of bytes int eh buffer, and the number of bytes to send/received </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__spi.html#ga600dc972f1064908b41b349c92d7647d">bcm2835_spi_transfer()</a> </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_ga06884e9cd71dfe380f846b09f47b7248_cgraph.png" border="0" usemap="#group__spi_ga06884e9cd71dfe380f846b09f47b7248_cgraph" alt=""/></div>
<map name="group__spi_ga06884e9cd71dfe380f846b09f47b7248_cgraph" id="group__spi_ga06884e9cd71dfe380f846b09f47b7248_cgraph">
<area shape="rect" id="node2" href="group__spi.html#gac24692f270bb3411990ea706ddd4fee9" title="bcm2835_spi_transfernb" alt="" coords="227,81,407,108"/><area shape="rect" id="node3" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="457,56,628,83"/><area shape="rect" id="node4" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="679,5,828,32"/><area shape="rect" id="node6" href="group__lowlevel.html#ga1c158b76d194b94d0b2fb1488f9ff30e" title="bcm2835_peri_write_nb" alt="" coords="456,107,629,133"/><area shape="rect" id="node7" href="group__lowlevel.html#ga0f541d0997978dd30f60231b64f10230" title="bcm2835_peri_read_nb" alt="" coords="457,157,629,184"/><area shape="rect" id="node5" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="678,56,829,83"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gac24692f270bb3411990ea706ddd4fee9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bcm2835_spi_transfernb </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>tbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>rbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Transfers any number of bytes to and from the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer. Clocks the len 8 bit bytes out on MOSI, and simultaneously clocks in data from MISO. The data read read from the slave is placed into rbuf. rbuf must be at least len bytes long Uses polled transfer as per section 10.6.1 of the BCM 2835 ARM Peripherls manual </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tbuf</td><td>Buffer of bytes to send. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">rbuf</td><td>Received bytes will by put in this buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Number of bytes in the tbuf buffer, and the number of bytes to send/received </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__spi.html#ga600dc972f1064908b41b349c92d7647d">bcm2835_spi_transfer()</a> </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__spi_gac24692f270bb3411990ea706ddd4fee9_cgraph.png" border="0" usemap="#group__spi_gac24692f270bb3411990ea706ddd4fee9_cgraph" alt=""/></div>
<map name="group__spi_gac24692f270bb3411990ea706ddd4fee9_cgraph" id="group__spi_gac24692f270bb3411990ea706ddd4fee9_cgraph">
<area shape="rect" id="node2" href="group__lowlevel.html#ga01949a6285305f38ce0a47154e55c1b6" title="bcm2835_peri_set_bits" alt="" coords="236,56,407,83"/><area shape="rect" id="node3" href="group__lowlevel.html#ga5f242135f5088f8c319492426a1ed5e3" title="bcm2835_peri_read" alt="" coords="457,5,607,32"/><area shape="rect" id="node5" href="group__lowlevel.html#ga1c158b76d194b94d0b2fb1488f9ff30e" title="bcm2835_peri_write_nb" alt="" coords="235,107,408,133"/><area shape="rect" id="node6" href="group__lowlevel.html#ga0f541d0997978dd30f60231b64f10230" title="bcm2835_peri_read_nb" alt="" coords="235,157,407,184"/><area shape="rect" id="node4" href="group__lowlevel.html#ga639da6963ab76e3109b9909f3a9e6171" title="bcm2835_peri_write" alt="" coords="457,56,607,83"/></map>
</div>
</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 16 2013 16:20:03 for RaspBerryPi power control by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
